package com.example.pjy.service.impl;

import com.example.pjy.mapper.RulesMapper;
import com.example.pjy.pojo.Rules;
import com.example.pjy.service.RulesService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RulesServiceImpl implements RulesService {


    @Resource
    private RulesMapper rulesMapper;




    @Override
    public void add(Rules rules){
        rulesMapper.add(rules);
    }




    @Override
    public List<Rules> list(){
        return rulesMapper.list();//只能查询当前用户的所有分类 告诉mapper层当前用户是谁
    }





    @Override
    public Rules findByYear(Integer year){
        Rules ru = rulesMapper.findByYear(year);
        return ru;
    }




    @Override
    public void updateru(Rules rules){
        rulesMapper.updateru(rules);
    }




    @Override
    public void delete(int rulesId){
        rulesMapper.delete(rulesId);
    }
}
